/*
 * Created on 18 aot 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package gestionSimpleATester;


public abstract class Operation {

	/**
	 *  
	 * This attribute memorizes the amount involved in the operation
	 * 
	 */
	private float amount;

	/**
	 *  
	 * @uml.property name="amount"
	 * 
	 */
	public float getAmount() {
		return amount;
	}

	/**
	 *  
	 * @uml.property name="amount"
	 * 
	 */
	public void setAmount(float amount) {
		this.amount = amount;
	}

	/**
	 * Sets the amount with the parameter
	 * @throws Exception 
	 */
	/**
	 * Bro ! maybe the amount value may be negatif is the case of 
	 * if the operation is a debit operation ...
	 * 
	 * 
	 * BUG FIXED : a negative amount is not allowed
	 */
	public Operation(float amount) throws Exception {
		if(amount<0){
			throw new Exception("Warning: the amount is negative: "+amount);
		}
		this.amount = amount;
	}

	/**
	 * Returns the type of the operation as a String. 
	 */
	public abstract String getOperationType();

}
